package com.ruoyi.applySender.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.applySender.mapper.ApplysenderMapper;
import com.ruoyi.applySender.domain.Applysender;
import com.ruoyi.applySender.service.IApplysenderService;

/**
 * 身份审核Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-07
 */
@Service
public class ApplysenderServiceImpl implements IApplysenderService 
{
    @Autowired
    private ApplysenderMapper applysenderMapper;

    @Override
    public int passApply(int id) {
        return applysenderMapper.updataState(1,id);
    }

    @Override
    public int changeRole(int userId) {
        return applysenderMapper.changeRole(userId,4);
    }

    @Override
    public int backApply(int id) {
        return applysenderMapper.updataState(-1,id);
    }

    /**
     * 查询身份审核
     * 
     * @param id 身份审核主键
     * @return 身份审核
     */
    @Override
    public Applysender selectApplysenderById(Integer id)
    {
        return applysenderMapper.selectApplysenderById(id);
    }

    /**
     * 查询身份审核列表
     * 
     * @param applysender 身份审核
     * @return 身份审核
     */
    @Override
    public List<Applysender> selectApplysenderList(Applysender applysender)
    {
        return applysenderMapper.selectApplysenderList(applysender);
    }

    /**
     * 新增身份审核
     * 
     * @param applysender 身份审核
     * @return 结果
     */
    @Override
    public int insertApplysender(Applysender applysender)
    {
        return applysenderMapper.insertApplysender(applysender);
    }

    /**
     * 修改身份审核
     * 
     * @param applysender 身份审核
     * @return 结果
     */
    @Override
    public int updateApplysender(Applysender applysender)
    {
        return applysenderMapper.updateApplysender(applysender);
    }

    /**
     * 批量删除身份审核
     * 
     * @param ids 需要删除的身份审核主键
     * @return 结果
     */
    @Override
    public int deleteApplysenderByIds(Integer[] ids)
    {
        return applysenderMapper.deleteApplysenderByIds(ids);
    }

    /**
     * 删除身份审核信息
     * 
     * @param id 身份审核主键
     * @return 结果
     */
    @Override
    public int deleteApplysenderById(Integer id)
    {
        return applysenderMapper.deleteApplysenderById(id);
    }
}
